Page({
  data: {
    repairItem: [],
  },
  onShow() {
    this.getRepairItem()
  },
  async getRepairItem() {
    const {
      code,
      data: { rows: repairItem },
    } = await wx.http.get('/repair', { current: 1, pageSize: 15 })
    if (code !== 10000) return wx.utils.toast()
    this.setData({
      repairItem,
    })
  },
  goDetail(e) {
    wx.navigateTo({
      url: '/repair_pkg/pages/detail/index?id=' + e.mark.id,
    })
  },
  addRepair() {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index',
    })
  },
})
